package org.yu.register.item;

import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.util.NonNullSupplier;
import net.minecraftforge.items.ItemStackHandler;
import org.yu.api.register.LazyItemMenu;
import org.yu.api.register.MenuHolder;
import org.yu.register.MenuTypeRegister;

import javax.annotation.Nonnull;
import java.util.function.Supplier;

public class RefractoryTank extends ContainerItem {
    public RefractoryTank(Properties pProperties) {
        super(pProperties);
    }

    @Override
    public MenuHolder<? extends LazyItemMenu> getMenu() {
        return MenuTypeRegister.refractoryTank;
    }

    @Nonnull
    @Override
    public NonNullSupplier<ItemStackHandler> getStackHandlerSupplier() {
        return ()->new ItemStackHandler(9){
            @Override
            public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
                return !(stack.getItem() instanceof RefractoryTank);
            }
        };
    }
}
